package com.gszy.auth.database;

import java.sql.ResultSet;
import java.sql.ResultSetMetaData;

/**
 * @author MeUChT
 */
public class ScalarHandler implements ResultSetHandler<Long>{



    @Override
    public Long handler(ResultSet resultSet) {
        Long result = null;
        try {
            if (resultSet.next()){
                ResultSetMetaData metaData = resultSet.getMetaData();
                String columnName = metaData.getColumnName(1);
                result = resultSet.getLong(columnName);

            }
        }catch (Exception e){
            e.printStackTrace();
        }
        return result;
    }
}
